﻿@{
    Layout = null;
}
@using Dnc.Extensions.Ui.Layui.Demo.Models
@model DemoModel
<!DOCTYPE html>
<html>
<head>
    <title>首页 -  Powered By Vinotec</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="icon" href="~/favicon.ico" />
    <link rel="shortcut icon" href="~/favicon.ico" />
    <link rel="stylesheet" href="~/lib/layui/css/layui.css" />
</head>
<body>
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo">layui 后台布局</div>
            <!-- 头部区域（可配合layui已有的水平导航） -->
            <ul class="layui-nav layui-layout-left">
                <li class="layui-nav-item"><a href="">控制台</a></li>
                <li class="layui-nav-item"><a href="">商品管理</a></li>
                <li class="layui-nav-item"><a href="">用户</a></li>
                <li class="layui-nav-item">
                    <a href="javascript:;">其它系统</a>
                    <dl class="layui-nav-child">
                        <dd><a href="">邮件管理</a></dd>
                        <dd><a href="">消息管理</a></dd>
                        <dd><a href="">授权管理</a></dd>
                    </dl>
                </li>
            </ul>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="javascript:;">
                        <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                        贤心
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="">基本资料</a></dd>
                        <dd><a href="">安全设置</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item"><a href="">退了</a></li>
            </ul>
        </div>

        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                <ul class="layui-nav layui-nav-tree" lay-filter="test">
                    <li class="layui-nav-item layui-nav-itemed">
                        <a class="" href="javascript:;">所有列表</a>
                        <dl class="layui-nav-child">
                            <dd><a href="/">页面1</a></dd>
                            <dd><a href="/Home/Index2">页面2</a></dd>
                            <dd><a href="/Home/Index3">页面3</a></dd>
                            <dd><a target="_blank" href="https://github.com/kulend/Ku.Core.Extensions/blob/master/Ku.Core.Extensions.Layui/README.md">使用方法</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>

        <div class="layui-body">
            <!-- 内容主体区域 -->
            <div style="padding: 15px;">
                <textarea style="width : 100%; height : 500px;">
    public class DemoModel
    {
        /// <summary>
        /// ID
        /// </summary>
        [DataType("hidden")]
        public long Id { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        [Required, MaxLength(20), MinLength(5)]
        [Display(Name = "名称", Description = "附加说明文字")]
        [RegularExpression(@@"^[a-zA-Z''-'\s]{1,40}$", ErrorMessage = "输入的名称不符合规则")]
        public string Name { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        [Required]
        [Display(Name = "手机号")]
        [DataType(DataType.PhoneNumber)] //也可以为[DataType("mobile")]
        public string Mobile { get; set; }

        /// <summary>
        /// 链接
        /// </summary>
        [MaxLength(256)]
        [Display(Name = "链接")]
        [DataType(DataType.Url)]
        public string Url { get; set; }

        /// <summary>
        /// Email
        /// </summary>
        [MaxLength(256)]
        [Display(Name = "Email")]
        [DataType(DataType.EmailAddress)]
        public string Email { get; set; }

        /// <summary>
        /// 序号
        /// </summary>
        [Display(Name = "序号", Prompt ="0~9999")]
        public int OrderIndex { get; set; } = 0;

        /// <summary>
        /// 序号
        /// </summary>
        [Display(Name = "数字", Prompt = "0~9999")]
        [Range(-1, 999.05)]
        public decimal Dec { get; set; } = 0;

        /// <summary>
        /// 开关
        /// </summary>
        [Display(Name = "开关", Prompt = "开|关")]
        public bool Switch { get; set; } = true;

        [Display(Name = "时间")]
        [DisplayFormat(DataFormatString = "yyyy-MM-dd HH:mm:ss")] //定义显示格式
        [DataType(DataType.DateTime)] //也可以这样[DataType("datetime")]
        public DateTime? Date { set; get; }

        [Display(Name = "年份")]
        [DataType("year")]
        public int Year { set; get; }

        [Display(Name = "月份")]
        [DisplayFormat(DataFormatString = "现在是yyyy年MM月")]
        [DataType("month")]
        public string Month { set; get; }

        /// <summary>
        /// 枚举
        /// </summary>
        [Display(Name = "性别")]
        public EmSex Sex { set; get; }

        /// <summary>
        /// 多行文本
        /// </summary>
        [Display(Name = "备注", Prompt = "请输入您的备注信息...")]
        [MaxLength(500)]
        [DataType(DataType.MultilineText)] //或者[DataType("textarea")]
        public string Remark { set; get; }
    }

    /// <summary>
    /// 性别
    /// </summary>
    public enum EmSex : short
    {
        [Display(Name = "保密")]
        Secret = 0,

        [Display(Name = "男")]
        Male = 1,

        [Display(Name = "女")]
        Female = 2
    }
                </textarea>
            </div>
            <div style="padding: 15px;">
                <a href="~/js/form.verify.js">form.verify.js</a> 下载
            </div>
        </div>

        <div class="layui-footer">
            <!-- 底部固定区域 -->
            © layui.com - 底部固定区域
        </div>
    </div>

    <environment names="Development">
        <script src="~/lib/jquery/dist/jquery.js"></script>
    </environment>
    <environment names="Staging,Production">
        <script src="~/lib/jquery/dist/jquery.min.js"></script>
    </environment>
    <script src="~/lib/layui/layui.js"></script>
    <script src="~/js/form.verify.js"></script>
    <script>
        //JavaScript代码区域
        layui.use(['element', 'form'], function () {
            var element = layui.element;
            var $ = layui.jquery;
        });
    </script>
</body>
</html>